package com.wwwarehouse.contract.orders.temp;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;


import com.wwwarehouse.common.activity.base.BaseFragment;
import com.wwwarehouse.common.tools.rsa.StringUtils;

import contract.wwwarehouse.com.contract.R;

/**
 * 订单导入设置-->提交页面
 * Created by ShineF on 2017/8/17 0017.
 */

public class ImportOrdersDetailsSubmitFragmentTemp extends BaseFragment implements View.OnClickListener {

    private View mRootView;
    private TextView mTvSubmitContent;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        mRootView = inflater.inflate(R.layout.fragment_import_orders_details_submit_temp, container, false);
        return mRootView;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        mTvSubmitContent = findView(mRootView, R.id.tv_submit_content);
        Button mBtnComplete = findView(mRootView, R.id.btn_complete);
        mBtnComplete.setOnClickListener(this);

    }

    @Override
    public void setTitle() {
        if (peekFragment() instanceof ImportOrdersDetailsSubmitFragmentTemp) {
            mActivity.setTitle(R.string.import_orders_setting);
        }
    }

    @Override
    public void requestDatas() {
        Bundle bundle = getArguments();
        if (bundle != null) {
            String startTime = bundle.getString("startTime");
            String endTime = bundle.getString("endTime");
            mTvSubmitContent.setText(StringUtils.getSpannedHtml(mActivity, R.string.import_submit_content, startTime, endTime, String.valueOf(5)));
        }
    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
    }
}
